<?php include "header.php" ?>
<form action="" method="post">
    <label>栏目名称：</label>
    <input type="text" name="catname">
    <input type="submit" name="sub">
</form>
<?php
include "../dbase/db.php";
if(!empty($_POST['sub'])){
    $catname=$_POST['catname'];
    $sql=mysql_query("insert into catagory (`catname`) VALUES ('$catname')",$link);
    if($sql){
        $a=<<<fgd
        <script>
        alert("插入成功");
        </script>
fgd;
        echo $a;
    }
    else{
        die("插入失败");
    }
}